import os
from django.conf.urls.defaults import patterns, include, url
from django.views.static import serve
#from django.contrib import admin
#admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', 'okuz.catalog.views.archive'),
	url(r'^import/$', 'okuz.catalog.views.load'),
    (r'^profile/', include('okuz.profile.urls')),
    (r'^catalog/', include('okuz.catalog.urls')),
    (r'^visit/', include('okuz.visit.urls')),
	(r'^media/(?P<path>.*)$', serve, {'document_root': os.path.join (os.path.abspath (os.path.dirname (__file__)), 'media')})
    #(r'^admin/', include(admin.site.urls)),
)

'''
#Aby media dzialaly na developerskim servie
#FIXME Poprawic ten rozpierdziel..
if True:
     from django.views.static import serve
     _media_url = '/media/';
     if _media_url.startswith('/'):
         _media_url = _media_url[1:]
         urlpatterns += patterns('',
                                 (r'^%s(?P<path>.*)$' % _media_url,
                                 serve,
                                 {'document_root': os.path.join (os.path.abspath (os.path.dirname (__file__)), 'media')}))
     del(_media_url, serve)
'''
